'\" te
.\" Copyright (c) 2000 Sun Microsystems, Inc. All Rights Reserved
.\" Copyright 1989 AT&T
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH SHARE 8 "Jan 23, 2007"
.SH NAME
share \- make local resource available for mounting by remote systems
.SH SYNOPSIS
.LP
.nf
\fBshare\fR [\fB-p\fR] [\fB-F\fR \fIFSType\fR] [\fB-o\fR \fIspecific_options\fR] [\fB-d\fR \fIdescription\fR]
     [\fIpathname\fR]
.fi

.SH DESCRIPTION
.sp
.LP
The \fBshare\fR command exports, or makes a resource available for mounting,
through a remote file system of type \fIFSType\fR. If the option \fB-F\fR
\fIFSType\fR is omitted, the first file system type listed in
\fB/etc/dfs/fstypes\fR is used as default. For a description of NFS specific
options, see \fBshare_nfs\fR(8). \fIpathname\fR is the pathname of the
directory to be shared. When invoked with no arguments, \fBshare\fR displays
all shared file systems.
.SH OPTIONS
.sp
.ne 2
.na
\fB\fB-d\fR \fIdescription\fR\fR
.ad
.sp .6
.RS 4n
The \fB-d\fR flag may be used to provide a description of the resource being
shared.
.RE

.sp
.ne 2
.na
\fB\fB-F\fR \fIFSType\fR\fR
.ad
.sp .6
.RS 4n
Specify the filesystem type.
.RE

.sp
.ne 2
.na
\fB\fB-o\fR \fIspecific_options\fR\fR
.ad
.sp .6
.RS 4n
The \fIspecific_options\fR are used to control access of the shared resource.
(See \fBshare_nfs\fR(8) for the NFS specific options.) They may be any of the
following:
.sp
.ne 2
.na
\fB\fBrw\fR\fR
.ad
.sp .6
.RS 4n
\fIpathname\fR is shared read/write to all clients. This is also the default
behavior.
.RE

.sp
.ne 2
.na
\fB\fBrw=\fR\fIclient\fR[\fI:client\fR]...\fR
.ad
.sp .6
.RS 4n
\fIpathname\fR is shared read/write only to the listed clients. No other
systems can access \fIpathname\fR.
.RE

.sp
.ne 2
.na
\fB\fBro\fR\fR
.ad
.sp .6
.RS 4n
\fIpathname\fR is shared read-only to all clients.
.RE

.sp
.ne 2
.na
\fB\fBro=\fR\fIclient\fR[\fI:client\fR]...\fR
.ad
.sp .6
.RS 4n
\fIpathname\fR is shared read-only only to the listed clients. No other systems
can access \fIpathname\fR.
.RE

Separate multiple options with commas. Separate multiple operands for an option
with colons. See EXAMPLES.
.RE

.sp
.ne 2
.na
\fB\fB-p\fR\fR
.ad
.sp .6
.RS 4n
Causes the share operation to persist across reboots.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fRSharing a Read-Only Filesystem
.sp
.LP
This line will share the \fB/disk\fR file system read-only at boot time.

.sp
.in +2
.nf
\fBshare\fR \fB-F\fR\fB nfs \fR\fB-o\fR \fBro /disk\fR
.fi
.in -2
.sp

.LP
\fBExample 2 \fRInvoking Multiple Options
.sp
.LP
The following command shares the filesystem \fB/export/manuals\fR, with members
of the netgroup having read-only access and users on the specified host having
read-write access.

.sp
.in +2
.nf
share \fB-F\fR nfs \fB-o\fR ro=\fInetgroup_name\fR,rw=\fIhost1\fR:\fIhost2\fR:\fIhost3\fR /export/manuals
.fi
.in -2
.sp

.SH FILES
.sp
.ne 2
.na
\fB\fB/etc/dfs/dfstab\fR\fR
.ad
.sp .6
.RS 4n
List of \fBshare\fR commands to be executed at boot time. Note that you can
invoke \fBshare\fR from a command line and use the \fB-p\fR option, described
above, as an alternative to editing this file.
.RE

.sp
.ne 2
.na
\fB\fB/etc/dfs/fstypes\fR\fR
.ad
.sp .6
.RS 4n
List of file system types; NFS is the default.
.RE

.sp
.ne 2
.na
\fB\fB/etc/dfs/sharetab\fR\fR
.ad
.sp .6
.RS 4n
System record of shared file systems.
.RE

.SH SEE ALSO
.sp
.LP
.BR attributes (7),
.BR mountd (8),
.BR nfsd (8),
.BR share_nfs (8),
.BR shareall (8),
.BR unshare (8)
.SH NOTES
.sp
.LP
Export (old terminology): file system sharing used to be called exporting on
SunOS 4.x, so the \fBshare\fR command used to be invoked as \fBexportfs\fR(1B)
or \fB/usr/sbin/exportfs\fR.
.sp
.LP
If \fBshare\fR commands are invoked multiple times on the same filesystem, the
last \fBshare\fR invocation supersedes the previous\(emthe options set by the
last \fBshare\fR command replace the old options. For example, if read-write
permission was given to \fBusera\fR on \fB/somefs\fR, then to give read-write
permission also to \fBuserb\fR on \fB/somefs\fR:
.sp
.LP
\fBexample% share -F nfs -o rw=usera:userb /somefs\fR
.sp
.LP
This behavior is not limited to sharing the root filesystem, but applies to all
filesystems.
